<?php

namespace App\Containers\AppSection\BankDetail\UI\API\Transformers;

use App\Containers\AppSection\BankDetail\Models\BankDetail;
use App\Ship\Parents\Transformers\Transformer;

class BankDetailTransformer extends Transformer
{
    protected array $defaultIncludes = [

    ];

    /**
     * @var  array
     */
    protected array $availableIncludes = [

    ];

    public function transform(BankDetail $t): array
    {
        return [
            'object' => $t->getResourceKey(),
            'include' => $this->getAvailableIncludes(),
            'id' => $t->getHashedKey(),
            'name' => $t->name,
            'bik' => $t->bik,
            'correspondent_account' => $t->correspondent_account,
            'inn' => $t->inn,
            'checking_account' => $t->checking_account,
            'master_account' => $t->master_account,
            'created_at' => $this->dateFormatter($t->created_at),
            'updated_at' => $this->dateFormatter($t->updated_at),
            'readable_created_at' => $t->created_at->diffForHumans(),
            'readable_updated_at' => $t->updated_at->diffForHumans()
        ];
    }
}
